package com.canyou.system.entity.user;

import com.canyou.utils.RegexUtils;
import io.swagger.annotations.ApiModel;
import lombok.Data;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;

/**
 * 修改用户密码模型
 *
 * @author canyou
 * @since 2019-05-14
 */
@Data
@Accessors(chain = true)
@ApiModel(value = "UserPasswordUpdateDTO", description = "修改用户密码模型")
public class UserPasswordUpdateDTO {

    /**
     * 密码
     */
    @NotBlank(message = "旧密码不能为空")
    private String password;

    /**
     * 新密码
     */
    @NotBlank(message = "新密码不能为空")
    @Pattern(regexp = RegexUtils.USER_PASSWORD, message = "密码最少6位")
    private String newPassword;

}
